<meta charset="UTF-8">
<div id="jt808add">
    <div style="padding:10px">
        <i-table size="small" border :columns="columns" :data="tableData" :height="tableHeight" :loading="loading"></i-table>
        <script>
            new Vue({
                el: '#jt808add',
                data: {
                    loading: false,
                    tableHeight: window.innerHeight - 80,
                    columns: [{
                        title: '附加Id',
                        key: 'id',
                        width: 100,
                    }, {
                        title: '长度',
                        key: 'length',
                        width: 80,
                    }, {
                        title: '说明',
                        key: 'mark'
                    }, {
                        title: '例子',
                        key: 'example'
                    }, ],
                    tableData: [],
                },
                methods: {
                    init: function() {
                        var me = this;
                        me.loading = true;
                        utils.sendAjax(myUrls.queryJt808Add(), {}, this.doQueryJt808Add, function() {
                            me.loading = false;
                        });
                    },
                    doQueryJt808Add: function(resp) {
                        this.loading = false;
                        this.tableData = resp.records ? resp.records : []
                    },
                    calcTableHeight: function() {
                        var wHeight = window.innerHeight;
                        if (wHeight < 760) {
                            wHeight = 760;
                        }
                        this.tableHeight = wHeight - 80;
                    },
                },
                mounted: function() {
                    var me = this;
                    window.onresize = function() {
                        me.calcTableHeight();
                    }
                    me.init();
                    me.calcTableHeight();
                }
            })
        </script>
    </div>
</div>